<!DOCTYPE html>
<html>

<head>
    <meta charset="utf-8">
    <title>GAP</title>
    <meta name="viewport" content="width=device-width, initial-scale=1,maximum-scale=1, user-scalable=no">
    <meta name="apple-mobile-web-app-capable" content="yes">
    <meta name="apple-mobile-web-app-status-bar-style" content="black">
    <script src="https://cdn.bootcss.com/jquery/3.3.0/jquery.min.js" type="text/javascript"></script>
    <script src="https://cdn.jsdelivr.net/npm/bootstrap@3.3.7/dist/js/bootstrap.min.js" type="text/javascript"></script>
    <link href="https://cdn.jsdelivr.net/npm/bootstrap@3.3.7/dist/css/bootstrap.min.css" rel="stylesheet" />
</head>
<style type="text/css">
html,
body {
  
    width: 100%;
    min-height: 100%;
    padding: 0;
    margin: 0;
}

body {
    background-image: url(image/bg.png);
    background-size: 100% 100%;
    background-position: top;
    background-repeat: no-repeat;
    min-height: 100%;
}

.logo {
    width: 100%;
    margin-top: 20px;
}

#registerFormData {}

#registerFormData button {
    border: 0;
    font-size: 14px;
    color: #FFF;
    padding: 10px;
    /*width: 60%;*/
    /*background-color: rgb(52,131,60);*/
}

.verify_btn {
    width: 30%;
    display: inline-block;
    padding: 0 0 !important;
    height: 34px;
    color: #00A0E9!important;
    background: none;
}

.verify_btn[disabled] {
    background-color: #e5e5e5;
}

form {
    margin-top: 50px;
    background-image: url(image/form_bg.png);
    background-size: 100% 100%;
    background-repeat: no-repeat;
    padding: 10px;
    padding-bottom: 3rem;
}

.form-group {
    width: 80%;
    margin-left: 10%;
}


h4 {
    border-bottom: 1px dashed #FFF;
    color: #FFF;
    text-align: center;
    padding-bottom: 10px;
}

.introduce {
    text-align: center;
    display: flex;
    justify-content: space-between;
}

.introduce div {
    width: 30%;
    margin-left: 2%;
    height: 70px;
    font-size: 12px;
    color: white;
    padding-top: 15px;

}



.register-tip {
    margin-top: 3%;
    font-size: 1.6rem;
    text-align: center;
    margin-bottom: 10px;
}

.btn-primary {
    width: 100%;
    background: url("image/submit_btn.png")no-repeat;
    -webkit-background-size: 100% 100%;
}

.introduce-two {
    width: 96%;
    margin-left: 2%;
    margin-top: 5%;
    text-align: center;
}

.introduce-two div {
    width: 33%;
    font-size: 1.3rem;
    color: black;
}

.introduce-two img {
    width: 80px;
    height: 74px;
}

.introduce-two p {
    margin-top: 10px;
    font-size: 12px;
}


.introduce-three {
    width: 96%;
    margin-left: 2%;
    margin-top: 5%;
    text-align: center;
}

.introduce-three div {
    font-size: 1.3rem;
    color: black;
}


.introduce-three img {
    width: 80px;
    height: 74px;
}

.introduce-three p {
    margin-top: 10px;
}

.bottom-tips {
    margin-top: 2rem;
    color: white;
    text-align: center;
    padding-bottom: 2rem;
    font-size: 12px;
}

#img_input {
    opacity: 0;
    background-image: url("../img/tx@2x.png")no-repeat;
    background-color: #000;
    width: 84px;
    height: 84px;
    position: absolute;
    top: 5rem;
    left: 8.5rem;
}

.preview {
    width: 100%;
}
.bg_yy{
    color: #00FFF6;
    background: #5e6496;
    height: 30px;
    line-height: 30px;
    border-radius: 4px;
    margin-top: 1rem;
}
.yq{
    text-align: center;
}
.yq>img{
    width:60%;
}
.down{
    background: url("image/bg_hui.png")no-repeat;
    padding: .5rem 0px;

}
.logo_a>img{
    width: 47px;
    height: 49px;
}
p{
    margin: 0px!important;
}
.p2{
    color: #b4b4b4;
    font-size: 12px;
}
.xz_but{
    background: url("image/submit_btn.png")no-repeat;
    width:70px;
    height: 25px;
    background-size:100% 100%;
    margin: 13px 0px 0px -20px;
    text-align: center;
    line-height: 25px;
}
.mid{
    margin-top: 0.5rem;
}
.box{
    width: 95%;
    display: flex;
    justify-content: space-between;
    margin-left: 7px;
}
.spe{
    width:32%;
    font-size: 12px;
    color: #fff;
    height: 6rem;
}
.spe>div{
    text-align: center;
    padding: 0px 6px;
}
.spe>div:nth-child(1){
    margin-top: 1rem;
}
.form-control{
    color: #a09d9d;
}
.row {
     margin-right: 0px!important;
    margin-left: 0px!important;
}
.yy_qh{
    color: #fff;
    float: right;
    padding: .5rem 0px;
    cursor: pointer;
}
a:focus, a:hover {
    text-decoration: none!important;
    color: #00FFF6!important;
}
#gotCode{
    background: none!important;
}
.from-groups{
    width: 80%;
    margin-left: 10%;
    margin-bottom: 5%;
}
.from-groups img{
    width: 62%;
}
</style>

<body>
    <div class="container-fluid">
        <a href="javascript:load();" class="yy_qh">(English)</a>
        <marquee class="bg_yy">欢迎！gap全球与您在财富之路共同成长</marquee>
        <a href="#" id="fileSelect">
            <div class="icon_tx preview_box">
                <img style="width:100%;margin-top:3rem;" src="image/logo.png" alt="">
            </div>
        </a>
        <input id="img_input" type="file" accept="image/*" />
        <label for="img_input"></label>
        <div class="yq"><img src="image/yq_zi.png" alt=""></div>
        <form id="registerFormData">
            <div class="box">
                    <div class="spe" style="background: url(image/nav_bg_1.png);background-size: 100% 100%;margin: 3rem 0px 0px 0px;">
                        <div>平台型战略</div>
                        <div>(去中心化系统融合)</div>
                    </div>
                    <div class="spe" style="background: url(image/nav_bg_2.png);background-size: 100% 100%;margin: 3rem 0px 0px 0px;">
                        <div>导入钱包</div>
                        <div>(支持多种数字token)</div>
                    </div>
                    <div class="spe" style="background: url(image/nav_bg_3.png);background-size: 100% 100%;margin: 3rem 0px 0px 0px;">
                        <div>应用生态DAPP</div>
                        <div>(更强的落地)</div>
                    </div>
                </div>
            <div class="register-tip">欢迎各界”领导”,“老师”下载注册</div>
            <input type="hidden" name="type" value="1">
            <div class="form-group">
                <input type="text" class="form-control" id="nickname" name="user_name" placeholder="用户名">
            </div>
            <div class="form-group">
                <select class="form-control" name="country" id='area'>
                    <option value="86">中国+86</option>
                    <option value="852">香港+852</option>
                    <option value="852">台湾+886</option>
                    <option value="1">美国+1</option>
                    <option value="91">印度+91</option>
                    <option value="62">印度尼西亚+62</option>
                    <option value="65">新加坡+65</option>
                    <option value="84">越南+84</option>
                    <option value="66">泰国+66</option>
                    <option value="855">柬埔寨+855</option>
                    <option value="44">英国+44</option>
                    <option value="81">日本+81</option>
                    <option value="82">韩国+82</option>
                    <option value="63">菲律宾+63</option>
                    <option value="60">马来西亚+60</option>
                </select>
            </div>
            <div class="form-group">
                <input type="text" class="form-control" name="mobile" id="mobile" placeholder="绑定手机号码">
            </div>
            <div class="from-groups">
                <img src="http://gap.topscope.com.cn/captcha.html" alt="">
                <button type="button" class="verify_btn" id="goStart">重新获取</button>
            </div>
            <div class="form-group">
                <input type="type" class="form-control" name="password" id="verify_code" placeholder="请填写你的图形验证码">
            </div>
            <div class="form-group">
                <input id="code" type="text" class="form-control" name="verify_code" placeholder="验证码" style="width: 65%;display: inline-block;">
                <button type="button" class="verify_btn" id="gotCode">发送验证码</button>
            </div>
            <div class="form-group">
                <input type="password" class="form-control" name="password" id="password" placeholder="登录密码">
            </div>
            <div class="form-group">
                <input type="password" class="form-control" name="password" id="confirm_pwd" placeholder="重置密码">
            </div>
            <div class="form-group">
                <input type="type" disabled='true' class="form-control" name="repass" id="invite_code" placeholder="邀请码">
            </div>
            <div class="form-group">
                <button type="button" id="next" class="btn btn-primary" onclick="register()">
                    立即注册，成为大佬
                </button>
            </div>
            <div class="register-tip">丰富多样的技术呈现</div>
            <div class="row  introduce-two">
                <div class="col-xs-3">
                    <img src="image/nav_bg_4.png" />
                    <p>bbs满足 国际化需求</p>
                </div>
                <div class="col-xs-3">
                    <img src="image/nav_bg_5.png" />
                    <p>在这里可以 找到更多的同伴</p>
                </div>
                <div class="col-xs-3">
                    <img src="image/nav_bg_6.png" />
                    <p>拥有强大的 节点高度分布式</p>
                </div>
            </div>
            <div class="row  introduce-three">
                <div class="col-xs-2">
                </div>
                <div class="col-xs-4">
                    <img src="image/nav_bg_7.png" />
                    <p>国际化百家技术联合</p>
                </div>
                <div class="col-xs-4">
                    <img src="image/nav_bg_8.png" />
                    <p>更多的行业第一资讯</p>
                </div>
                <div class="col-xs-2">
                </div>
            </div>
        </form>
        <div class="bottom-tips">
            如有疑问咨询客服热线：+60-01156918493
            <p>工作日：9：00 - 22：00 非工作日：10：00 - 15：00</p>
        </div>
    </div>
    <footer style="color: white;">
        <div class="row down">
            <div class="col-xs-2 logo_a">
                <img src="image/logo_a.png"/>
            </div>
            <div class="col-xs-7 mid">
                <p>GAP-生态的缔造者</p>
                <p class="p2">能买币,能存币,能玩游戏,能升值</p>
            </div>
            <div class="col-xs-3">
                <div id="nexts" class="xz_but">立即下载</div>
            </div>
        </div>
    </footer>
</body>
<script>
window.onload = function() {
    function getQueryString(name) {

        var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)", "i");

        var r = window.location.search.substr(1).match(reg);

        if (r != null) return unescape(r[2]);
        return null;

    }
    function load(){
        var ur='reg_english.html?invite_code=' +getQueryString('invite_code');
        window.location.href=ur;

    }
    $("#invite_code").val(getQueryString('invite_code'))

    // alert(getQueryString('invite_code'))

    var reset_token = '';
    //重新刷新验证码
    
    $('#goStart').click(function() {
        $('.from-groups img').attr('src',"http://gap.topscope.com.cn/captcha.html?t=" + new Date().getTime())
    })



    //验证码接口
    $('#gotCode').click(function() {
        var time = null;
        this.disabled = true;
        var that = this;
        var count = 120;
        var area = $("#area option:selected").val();
        var mobile = $('#mobile').val()
        var verifiy_code = $('#verify_code').val()
        var aj = $.ajax({
            url: 'http://gap.topscope.com.cn/api.php/common/send_sms',
            data: {
                access_token: '5b7f60aca7e7f6f8c680b1b219ad3ec6',
                mobile: mobile,
                type: 1,
                area: area,
                verifiy_code,verifiy_code
            },
            type: 'post',
            cache: false,
            dataType: 'json',
            success: function(data) {

                that.disabled = false


                if (data.code == 1) {
                    alert(data['msg']);
                    return false
                }

                var timer = setInterval(function() {
                    that.disabled = true
                    count--;
                    that.innerHTML = "剩下" + count + "秒";
                    if (count == 0) {
                        that.disabled = false
                        $("#gotCode").css('background', '#4395FF');
                        clearInterval(timer);
                    }
                }, 1000);

                $("#gotCode").css('background', 'rgba(153,154,165,1)');
                alert(data['msg']);
                coding = data['dat']

            },
            error: function() {
                // alert(data['msg']);
            }
        });

    })



    let cover_id = ''
    let coding = ''
    // 上传图片的接口
    function select() {
        var ie = navigator.appName == "Microsoft Internet Explorer" ? true : false;
        if (ie) {
            document.getElementById("file").click();
        } else {
            var a = document.createEvent("MouseEvents");
            a.initEvent("click", true, true);
            document.getElementById("file").dispatchEvent(a);
        }
    }

    function submit() {
        //文件上传
    }
    $("#img_input").on("change", function(e) {
        var file = e.target.files[0]; //获取图片资源
        // 只选择图片文件
        if (!file.type.match('image.*')) {
            return false;
        }
        var reader = new FileReader();
        reader.readAsDataURL(file); // 读取文件
        // 渲染文件
        reader.onload = function(arg) {
            var img = '<img class="preview" src="' + arg.target.result + '" alt="preview"/>';
            $(".preview_box").empty().append(img);
        }

        var form_data = new FormData();
        var file = $("#img_input").prop("files")[0];
        var access_token = '5b7f60aca7e7f6f8c680b1b219ad3ec6'

        // 把上传的数据放入form_data
        form_data.append("file", file);
        form_data.append("access_token", access_token);

        $.ajax({
            type: "POST", // 上传文件要用POST
            url: "http://gap.topscope.com.cn/api.php/common/pictureUpload1",
            dataType: "json",
            crossDomain: true, // 如果用到跨域，需要后台开启CORS
            processData: false, // 注意：不要 process data
            contentType: false, // 注意：不设置 contentType
            data: form_data,
            success: function(data) {
                cover_id = data['data'].id
            },
            error: function() {
                alert("fail")
            }
        });
    });
    // 注册接口
    $('#next').click(function() {
        // 注册的接口
        var options = $("#gotCode")
        var options = $("#area option:selected")
        var area = options.val();
        var token = coding
        var access_token = '5b7f60aca7e7f6f8c680b1b219ad3ec6'
        var mobile = $("#mobile").val()
        var nickname = $("#nickname").val()
        var code = $("#code").val()
        var invite_code = $("#invite_code").val()
        var password = $("#password").val()
        var confirm_pwd = $("#confirm_pwd").val()


        var aj = $.ajax({
            url: 'http://gap.topscope.com.cn/api.php/common/register',
            data: {
                access_token: access_token,
                mobile: mobile,
                nickname: nickname,
                area: area,
                cover_id: cover_id,
                code: code,
                token: token,
                invite_code: invite_code,
                password: password,
                confirm_pwd: confirm_pwd
            },
            type: 'post',
            cache: false,
            dataType: 'json',
            success: function(data) {
                alert(data['msg']);
            },
            error: function() {
                alert(data['msg']);
            }
        });

    })
  
     $("#nexts").click(function () {
         window.location.href ="https://fir.im/bwmh";

       })

    //获取头部url的值

    //糖果的接口
    var invite_code = $("#invite_code").val()
    var aj = $.ajax({
        url: 'http://gap.topscope.com.cn/api.php/common/sweep_code',
        data: {
            access_token: '5b7f60aca7e7f6f8c680b1b219ad3ec6',
            invite_code: invite_code
        },
        type: 'post',
        cache: false,
        dataType: 'json',
        success: function(data) {


            // alert("修改成功！");
        },
        error: function() {
            alert("糖果的接口异常！");
        }
    });
}
</script>

</html>